/*
 * Improbability Drive
 * Phillip Cardon, Thach Nguyen, Cristopher Claeys
 * 4/26/2011
 */

package buffers;

import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * URLsRetrieved.
 * Represents all URLs that have been visited.
 * @author Phillip Cardon
 *
 */
public class URLsRetrieved {
	private final Set<URL> urlSet;
	
	public URLsRetrieved() {
		urlSet = Collections.synchronizedSet(new HashSet<URL>());
	}
	
	public boolean visited(URL link) {
		return urlSet.contains(link);
	}
	
	public boolean visit(URL link) {
		return urlSet.add(link);
	}

	public int size() {
		return urlSet.size();
	}
}
